//
// Created by LiuYou on 2021/5/19.
//

#include <cstdlib>
#include <unistd.h>
#include <cstdio>

/*
 * 质数/素数
 */
int main() {
    const int LEFT = 30000000;
//    const int RIGHT = 30000200;
    const int RIGHT = 30000200;
    int mark{};
    for (int i = LEFT; i <= RIGHT; ++i) {
        mark = 1;
        for (int j = 2; j < i / 2; ++j) {
            if (i % j == 0) {
                mark = 0;
                break;
            }
        }
        if (mark == 1) {
            std::fprintf(stdout, "%d is prime number.\n", i);
        }
    }


    std::exit(0);
}